<?php
$sql = 'SELECT * FROM ' . Tbladvertise::tbladvertise . '  WHERE  ' . Tbladvertise::status . ' = 1  AND  ' . Tbladvertise::page . ' = 1  AND ' . Tbladvertise::position . ' = "bottom" ORDER BY ' . Tbladvertise::date_modified . ' DESC LIMIT 3';
$result = mysql_query ( @$sql );
// var_dump($result);
$i = 1;
$border = "";
if (mysql_num_rows( $result ) > 0) {
	while ( $row = mysql_fetch_object ( $result ) ) {
		if (strtotime($row->{Tbladvertise::dateendpost} ) > strtotime(date("Y-m-d") )) {
			?>
			<div class="image">
				<a href="<?php echo $row->{Tbladvertise::link} ?>" target="_blank"
					alt="<?php echo $row->{Tbladvertise::link} ?>"
					title="<?php echo $row->{Tbladvertise::link} ?>"> 
					<img class="image_product_tap" src="<?php echo base_url.'/images/advertise/' . $row->{Tbladvertise::image} ?>" width="100%" />
				</a>
			</div>
			<br />
			aaaaa
		<?php
		}
	}?>
	<div class="image">
		<img class="image_product_tap" src="<?php echo base_url?>/images/advertise/default_advertise.png" width="100%"/>
	</div>
	<?php 
} else {
	?>
<div class="image">
	<img class="image_product_tap" src="<?php echo base_url?>/images/advertise/default_advertise.png" width="100%"/>
</div>
<?php
	}
	?>